using System.Configuration;

namespace TestSystem.BLL
{
    // <summary>
    /// Summary description for UniversitySettings
    /// </summary>
    class UniversitySettings : ConfigurationSection
    {
        [ConfigurationProperty("publications", IsRequired = true)]
        public PublicationsElement Publications
        {
            get { return (PublicationsElement)base["publications"]; }
        }

        [ConfigurationProperty("news", IsRequired = true)]
        public NewsElement News
        {
            get { return (NewsElement)base["news"]; }
        }

        [ConfigurationProperty("faculties", IsRequired = true)]
        public FacultyElement Faculties
        {
            get { return (FacultyElement)base["faculties"]; }
        }

        [ConfigurationProperty("departments", IsRequired = true)]
        public DepartmentElement Departments
        {
            get { return (DepartmentElement)base["departments"]; }
        }

        [ConfigurationProperty("lectors", IsRequired = true)]
        public LectorsElement Lectors
        {
            get { return (LectorsElement)base["lectors"]; }
        }

        [ConfigurationProperty("students", IsRequired = true)]
        public StudentsElement Students
        {
            get { return (StudentsElement)base["students"]; }
        }

        [ConfigurationProperty("forums", IsRequired = true)]
        public ForumsElement Forums
        {
            get { return (ForumsElement)base["forums"]; }
        }

        [ConfigurationProperty("profile", IsRequired = true)]
        public ProfileElement Profile
        {
            get { return (ProfileElement)base["profile"]; }
        }

        [ConfigurationProperty("gallery", IsRequired = true)]
        public GalleryElement Gallery
        {
            get { return (GalleryElement)base["gallery"]; }
        }

        [ConfigurationProperty("comments", IsRequired = true)]
        public CommentsElement Comments
        {
            get { return (CommentsElement)base["comments"]; }
        }
    }

    public class ForumsElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = "true")]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("threadPageSize", DefaultValue = 20)]
        public int ThreadPageSize
        {
            get { return (int)base["threadPageSize"]; }
        }

        [ConfigurationProperty("forumPageSize", DefaultValue = 10)]
        public int ForumPageSize
        {
            get { return (int)base["forumPageSize"]; }
        }

        [ConfigurationProperty("unApprovedPostsPageSize", DefaultValue = 20)]
        public int UnApprovedPostsPageSize
        {
            get { return (int)base["unApprovedPostsPageSize"]; }
        }

        [ConfigurationProperty("unApprovedPostsCacheDuration", DefaultValue = 10000)]
        public int UnApprovedPostsCacheDuration
        {
            get { return (int)base["unApprovedPostsCacheDuration"]; }
        }

        [ConfigurationProperty("forumsCacheDurtion", DefaultValue = 10000)]
        public int ForumsCacheDurtion
        {
            get { return (int)base["forumsCacheDurtion"]; }
        }

        [ConfigurationProperty("threadsCacheDuration", DefaultValue = 2000)]
        public int ThreadsCacheDuration
        {
            get { return (int)base["threadsCacheDuration"]; }
        }

        [ConfigurationProperty("postsCacheDuration", DefaultValue = 2000)]
        public int PostsCacheDuration
        {
            get { return (int)base["postsCacheDuration"]; }
        }

        [ConfigurationProperty("threadCountCacheDuration", DefaultValue = 2000)]
        public int ThreadCountCacheDuration
        {
            get { return (int)base["threadCountCacheDuration"]; }
        }

        [ConfigurationProperty("postsCountCacheDuration", DefaultValue = 2000)]
        public int PostsCountCacheDuration
        {
            get { return (int)base["postsCountCacheDuration"]; }
        }

        [ConfigurationProperty("defaultCacheDuration", DefaultValue = 5000)]
        public int DefaultCacheDuration
        {
            get { return (int)base["defaultCacheDurationn"]; }
        }

        [ConfigurationProperty("bronzePosterPosts", DefaultValue = 15)]
        public int BronzePosterPosts
        {
            get { return (int)base["bronzePosterPosts"]; }
        }

        [ConfigurationProperty("silverPosterPosts", DefaultValue = 50)]
        public int SilverPosterPosts
        {
            get { return (int)base["silverPosterPosts"]; }
        }

        [ConfigurationProperty("bronzePosterDescription", DefaultValue = "")]
        public string BronzePosterDescription
        {
            get { return (string)base["bronzePosterDescription"]; }
        }

        [ConfigurationProperty("silverPosterDescription", DefaultValue = "")]
        public string SilverPosterDescription
        {
            get { return (string)base["silverPosterDescription"]; }
        }

        [ConfigurationProperty("goldPosterDescription", DefaultValue = "")]
        public string GoldPosterDescription
        {
            get { return (string)base["goldPosterDescription"]; }
        }

        [ConfigurationProperty("goldPosterPosts", DefaultValue = 100)]
        public int GoldPosterPosts
        {
            get { return (int)base["goldPosterPosts"]; }
        }

        [ConfigurationProperty("hotThreadPosts", DefaultValue = 50)]
        public int HotThreadPosts
        {
            get { return (int)base["hotThreadPosts"]; }
        }
    }

    public class ProfileElement : ConfigurationElement
    {
        [ConfigurationProperty("maxAvatarSize", DefaultValue = 10240)]
        public int MaxAvatarSize
        {
            get { return (int)base["maxAvatarSize"]; }
        }
    }

    public class GalleryElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = true)]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("defaultAlbumImageUrl", DefaultValue = "album.jpg")]
        public string DefaultAlbumImageUrl
        {
            get { return (string) base["defaultAlbumImageUrl"]; }
        }

        [ConfigurationProperty("maxPhotoSize", DefaultValue = 2048000)]
        public int MaxPhotoSize
        {
            get { return (int)base["maxPhotoSize"]; }
        }

        [ConfigurationProperty("photosCacheDuration", DefaultValue = 2000)]
        public int PhotosCacheDuration
        {
            get { return (int)base["photosCacheDuration"]; }
        }

        [ConfigurationProperty("photosPerPage", DefaultValue = 30)]
        public int PhotosPerPage
        {
            get { return (int)base["photosPerPage"]; }
        }
    }

    public class StudentsElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = "true")]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("studentsPerDepartmentPageSize", DefaultValue = "20")]
        public int StudentsPerDepartmentPageSize
        {
            get { return (int)base["studentsPerDepartmentPageSize"]; }
        }

        [ConfigurationProperty("studentsPerGroupPageSize", DefaultValue = "15")]
        public int StudentsPerGroupPageSize
        {
            get { return (int)base["studentsPerGroupPageSize"]; }
        }

        [ConfigurationProperty("studentsCacheDuration", DefaultValue = "6000")]
        public int StudentsCacheDuration
        {
            get { return (int)base["studentsCacheDuration"]; }
        }
    }

    public class LectorsElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = "true")]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("lectorsPerDepartmentPageSize", DefaultValue = "10")]
        public int LectorsPerDepartmentPageSize
        {
            get { return (int)base["lectorsPerDepartmentPageSize"]; }
        }

        [ConfigurationProperty("lectorsCacheDuration", DefaultValue = "6000")]
        public int LectorsCacheDuration
        {
            get { return (int)base["lectorsCacheDuration"]; }
        }
    }

    public class FacultyElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = "true")]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("facultiesPageSize", DefaultValue = 15)]
        public int FacultiesPageSize
        {
            get { return (int)base["facultiesPageSize"]; }
        }

        [ConfigurationProperty("facultiesCacheDuration", DefaultValue = 6000)]
        public int FacultiesCacheDuration
        {
            get { return (int)base["facultiesCacheDuration"]; }
        }
    }

    public class DepartmentElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = "true")]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("departmentsPageSize", DefaultValue = 15)]
        public int DepartmentsPageSize
        {
            get { return (int)base["departmentsPageSize"]; }
        }

        [ConfigurationProperty("departmentsCacheDuration", DefaultValue = 6000)]
        public int DepartmentsCacheDuration
        {
            get { return (int)base["departmentsCacheDuration"]; }
        }
    }

    public class NewsElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = "true")]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("newsPageSize", DefaultValue = 10)]
        public int NewsPageSize
        {
            get { return (int)base["newsPageSize"]; }
        }

        [ConfigurationProperty("newsFromFacultyCount", DefaultValue = 2)]
        public int NewsFromFacultyCount
        {
            get { return (int)base["newsFromFacultyCount"]; }
        }

        [ConfigurationProperty("topUniversityNewsCount", DefaultValue = 10)]
        public int TopUniversityNewsCount
        {
            get { return (int)base["topUniversityNewsCount"]; }
        }

        [ConfigurationProperty("topFacultyNewsCount", DefaultValue = 5)]
        public int TopFacultyNewsCount
        {
            get { return (int)base["topFacultyNewsCount"]; }
        }

        [ConfigurationProperty("newsCacheDuration", DefaultValue = 10000)]
        public int NewsCacheDuration
        {
            get { return (int)base["newsCacheDuration"]; }
        }
    }

    public class PublicationsElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = true)]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("publicationsPageSize", DefaultValue = 15)]
        public int PublicationsPageSize
        {
            get { return (int)base["publicationsPageSize"]; }
        }

        [ConfigurationProperty("publicationsCacheDuration", DefaultValue = 3000)]
        public int PublicationsCacheDuration
        {
            get { return (int)base["publicationsCacheDuration"]; }
        }
    }

    public class CommentsElement : ConfigurationElement
    {
        [ConfigurationProperty("enableCaching", DefaultValue = false)]
        public bool EnableCaching
        {
            get { return (bool)base["enableCaching"]; }
        }

        [ConfigurationProperty("commentsPageSize", DefaultValue = 10)]
        public int CommentsPageSize
        {
            get { return (int)base["commentsPageSize"]; }
        }

        [ConfigurationProperty("commentsCacheDuration", DefaultValue = 1000)]
        public int CommentsCacheDuration
        {
            get { return (int)base["commentsCacheDuration"]; }
        }
    }
}
